function MenuBar_getSelectedIndex(id) {
	var menuBar = document.getElementById(id);
	if (menuBar != null) {
		var selIndex = menuBar.getAttribute("selIndex");
		if (selIndex == null) {
			menuBar.setAttribute("selIndex", -1);
			selIndex = -1;
		}
		return parseInt(selIndex);
	} else {
		return -1;
	}
}

function MenuBar_setSelectedIndex(id, index) {
	var menuBar = document.getElementById(id);
	if (menuBar != null) {
		menuBar.setAttribute("selIndex", index);
	}
}